package com.tea.funct.service.impl;

import java.util.List;
import com.tea.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tea.funct.mapper.TeaRenewMapper;
import com.tea.funct.domain.TeaRenew;
import com.tea.funct.service.ITeaRenewService;

/**
 * 会员续费产品Service业务层处理
 * 
 * @author Sophia
 * @date 2024-05-25
 */
@Service
public class TeaRenewServiceImpl implements ITeaRenewService 
{
    @Autowired
    private TeaRenewMapper teaRenewMapper;

    /**
     * 查询会员续费产品
     * 
     * @param id 会员续费产品主键
     * @return 会员续费产品
     */
    @Override
    public TeaRenew selectTeaRenewById(Long id)
    {
        return teaRenewMapper.selectTeaRenewById(id);
    }

    /**
     * 查询会员续费产品列表
     * 
     * @param teaRenew 会员续费产品
     * @return 会员续费产品
     */
    @Override
    public List<TeaRenew> selectTeaRenewList(TeaRenew teaRenew)
    {
        return teaRenewMapper.selectTeaRenewList(teaRenew);
    }

    /**
     * 新增会员续费产品
     * 
     * @param teaRenew 会员续费产品
     * @return 结果
     */
    @Override
    public int insertTeaRenew(TeaRenew teaRenew)
    {
        teaRenew.setCreateTime(DateUtils.getNowDate());
        return teaRenewMapper.insertTeaRenew(teaRenew);
    }

    /**
     * 修改会员续费产品
     * 
     * @param teaRenew 会员续费产品
     * @return 结果
     */
    @Override
    public int updateTeaRenew(TeaRenew teaRenew)
    {
        teaRenew.setUpdateTime(DateUtils.getNowDate());
        return teaRenewMapper.updateTeaRenew(teaRenew);
    }

    /**
     * 批量删除会员续费产品
     * 
     * @param ids 需要删除的会员续费产品主键
     * @return 结果
     */
    @Override
    public int deleteTeaRenewByIds(Long[] ids)
    {
        return teaRenewMapper.deleteTeaRenewByIds(ids);
    }

    /**
     * 删除会员续费产品信息
     * 
     * @param id 会员续费产品主键
     * @return 结果
     */
    @Override
    public int deleteTeaRenewById(Long id)
    {
        return teaRenewMapper.deleteTeaRenewById(id);
    }
}
